from django.db import models

# Create your models here.
from django.db import models
from django.contrib.auth.models import User



class SearchHistory(models.Model):
    """用户搜索历史"""
    keyword = models.CharField(max_length=100, verbose_name="搜索关键词")
    created_at = models.DateTimeField(auto_now_add=True, verbose_name="搜索时间")
    class Meta:
        verbose_name = "用户搜索历史"
    def __str__(self):
        return self.keyword

class HotSearchTag(models.Model):
    """热门搜索标签"""
    tag = models.CharField(max_length=100, verbose_name="标签名称", unique=True)
    click_count = models.IntegerField(default=0, verbose_name="点击量")
    is_hot = models.BooleanField(default=False, verbose_name="是否热门（带火焰标识）")
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)
    class Meta:
        verbose_name = "热门搜索标签"
    def __str__(self):
        return self.tag